import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'

import store from "./stores/index.js";

import App from './App.vue'
import router from './router'

import element from 'element-plus';
import 'element-plus/dist/index.css';

import QfDialog from "./components/QfDialog.vue"

const app = createApp(App)

app.component(QfDialog);

app.use(createPinia());
app.use(router);
app.use(element);
app.use(store);

app.directive("color2", {
  created(el, binding){
    // console.log(el);
    // console.log(binding)
    const c = binding.value || "#ccc";
    if(binding.arg === "font"){
      el.style.color = c;
    }else if(binding.arg === "background"){
      el.style.backgroundColor = c;
    }
  },
  updated(el, binding){
    const c = binding.value || "#ccc";
    if(binding.arg === "font"){
      el.style.color = c;
    }else if(binding.arg === "background"){
      el.style.backgroundColor = c;
    }
  }
})

app.mount('#app');